
Page({
    canvasIdErrorCallback: function (e) {
        console.error(e.detail.errMsg)
    },
    onReady:function(e){
        var context = wx.createContext()

        context.setStrokeStyle( "#00ff00" )
        context.setLineWidth( 5 )
        context.rect( 0, 0, 200, 200 )
        context.stroke()
        //
        context.drawImage("img/stype_1/bg.png",0,0)
        //var img = new Image()
        //img.src = "img/stype_1/bg.png"
        //context.drawImage(img,0,0)
        // wx.chooseImage({
        //     success:function(res){
        //         context.drawImage(res.tempFilePaths[0],0,0)
        //         wx.drawCanvas({
        //             canvasId:'chess_box',
        //             actions:context.getActions()
        //         })
        //     }
        // })

        //
        wx.drawCanvas({
        	canvasId:'chess_box',
        	actions:context.getActions()
        })
    }
})